<%= form_for(@device, html: {class: 'form-horizontal'}) do |f| %>
  <% if @device.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@device.errors.count, "error") %> prohibited this device from being saved:</h2>

      <ul>
      <% @device.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <fieldset>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">IP地址:</label>
      <div class="controls">
        <%= f.text_field :ip %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">系统类型:</label>
      <div class="controls">
        <%= f.select :os_type, options_for_select(@os_type_options, @device.os_type) %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">系统名称:</label>
      <div class="controls">
        <%= f.text_field :os_name %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">系统位数:</label>
      <div class="controls">
        <%= f.select :os_bit, options_for_select(@os_bit_options, @device.os_bit) %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">浏览器版本:</label>
      <div class="controls">
        <%= f.select :browser_version, options_for_select(@browser_version_options, @device.browser_version) %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">浏览器位数:</label>
      <div class="controls">
        <%= f.select :browser_bit, options_for_select(@browser_bit_options, @device.browser_bit) %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">负责人:</label>
      <div class="controls">
        <%= f.text_field :owner %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">用途描述:</label>
      <div class="controls">
        <%= f.text_field :description %>           
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">备注信息:</label>
      <div class="controls">
        <%= f.text_area :remark %>           
      </div>
    </div>
    <%= f.hidden_field :status, {value: 1} %>
    <div class="control-group">
      <label></label>
      <!-- Button -->
      <div class="controls">
        <%= f.submit "保存", {class: 'btn btn-success'}%>
        <%= link_to "返回", devices_path, {class: 'btn'} %>
      </div>
    </div>
  </fieldset>
<% end %>
